blob: 0315ff8cb6575ca2c9a3904594e07c00737d2ede (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
import { NextRequest } from "next/server";
import { buildHandler } from "@/app/api/v1/utils/handler";
export const dynamic = "force-dynamic";
export const GET = (
req: NextRequest,
{ params }: { params: { bookmarkId: string } },
) =>
buildHandler({
req,
handler: async ({ api }) => {
const bookmark = await api.bookmarks.getBookmark({
bookmarkId: params.bookmarkId,
});
return { status: 200, resp: bookmark };
},
});
export const DELETE = (
req: NextRequest,
{ params }: { params: { bookmarkId: string } },
) =>
buildHandler({
req,
handler: async ({ api }) => {
await api.bookmarks.deleteBookmark({
bookmarkId: params.bookmarkId,
});
return { status: 204 };
},
});
|